//
//  UIButtonTVC.m
//  UILbrary
//
//  Created by mac on 16/7/20.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "UIButtonTVC.h"
#import "TopImageBottomTitleVC.h"

@interface UIButtonTVC ()
@property (nonatomic,strong) NSArray *titleArr;
@end
@implementation UIButtonTVC


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.titleArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UIButtonTVCcell"];
    
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"UIButtonTVCcell"];
    }
    cell.textLabel.text = self.titleArr[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0) {
        TopImageBottomTitleVC *vc = [[TopImageBottomTitleVC alloc] init];
        [self.navigationController pushViewController:vc animated:YES];
    }
}

- (NSArray *)titleArr{
    return @[@"上图下字"];
}
@end
